#pragma once
#include "UIElement.h"

namespace DirectUI
{
	class CUIImage : public CUIElement
	{
	public:
		DECLARE_CLASS(CUIImage, Image)

		UI_DECLARE_INTERFACE_MAP();

		UI_BEGIN_INTERFACE_PART(CUIImage, Image, IUIImage)
		UI_END_INTERFACE_PART(Image)

		CUIImage(void);
		virtual ~CUIImage(void);

		virtual void ParseAttribute(LPCTSTR lpszAttr);
		virtual void OnParseAttribute(xml_attribute& attr);
		virtual void OnDraw(HDC hDC, IUIRender* lpRender);

	private:
		void	DrawAlignImage(IUIRender* lpRender, HDC hDC, CRect rc);

	private:
		CUIObjectPtr<IUIImageSource>	m_spImageSource;
	};
};
